package cn.yunyichina.provider.pay.factory;

import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by Lullaby on 2017/6/28.
 */
public class PayNotifyThreadFactory implements ThreadFactory {

    private AtomicInteger threadNumber = new AtomicInteger(1);

    private String prefix = "";

    PayNotifyThreadFactory(String prefix) {
        this.prefix = prefix;
    }

    public Thread newThread(Runnable r) {
        return new Thread(r, prefix + "-" + threadNumber.get());
    }

}
